
define(function(require, exports, module) {
    var $=require('zepto');
    cn=require('conment');
    api=require('api');
    lg=require('login');
    pop=require('popup');
    template=require('template');
    require('jqpage');
    module.exports = {
        int:{
            pageNo:1,
            pageSize:10,
            isTime:false
        },
        history:function (num) {
            var _this = this;
            cn.Ajax(api.water, {page:num, Length: _this.int.pageSize}, function (c) {
                var json = {
                    data:[]
                };
                json.data = c.list;
                var result = TrimPath.processDOMTemplate("tempp", json);
                document.getElementById("history-list").innerHTML = result;
                $.jqPaginator('#pagination1', {
                    totalPages: 5,
                    currentPage:  c.page,
                    prev: '<li class="prev"><a href="javascript:;">上一页</a></li>',
                    next: '<li class="next"><a href="javascript:;">下一页</a></li>',
                    page: '<li class="page"><a href="javascript:;">{{page}}</a></li>',
                    onPageChange: function (num, type) {
                        if(type == 'change'){
                            _this.history(num)
                        }
                    }
                });
            },'post')
        },
        init:function () {
            var _this=this;
            _this.history()
        }
    }

});